package cn.cvs.dao;

import cn.cvs.pojo.SysUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface SysUserMapper {

    /**
     * 统计用户数量
     * @return
     */
    public int count();

    List<SysUser> getUserList(@Param("startIndex") Integer startIndex, @Param("pageSize") Integer pageSize);

    List<SysUser> getUsersByRealName(String realName);

    List<SysUser> getUsersByPojo(SysUser sysUser);

    List<SysUser> getUsersByMap(Map<String,Object> map);

    List<SysUser> getUsersByParams(@Param("realName") String realName, @Param("role_id") Integer roleId);

    List<SysUser> getUsersWithRoleName(@Param("realName") String realName, @Param("role_id") Integer roleId);


    List<SysUser> getUsersWithSysRole(@Param("realName") String realName, @Param("role_id") Integer roleId);

    List<SysUser> getUsersWithAddressList();

    int add(SysUser sysUser);

    // map.put("array",roleIds);
    List<SysUser> getUsersByRoleArray(Integer[] roleIds);

    // map.put("list",roleIds);
    List<SysUser> getUsersByRoleList(List<Integer> roleIds);

    // map = map
    List<SysUser> getUsersByRoleMap(Map<String,Object> map);

    int update(SysUser sysUser);
}
